var wsServer = 'ws://192.168.33.10:8811';
var websocket = new WebSocket(wsServer);
websocket.onopen = function(evt){
    console.log('初始化');   
}
websocket.onmessage = function(evt){
    push(evt.data);
}
websocket.onclose = function(evt){
    console.log('关闭');
}
websocket.onerror = function(evt){
    console.log('错误');
}
function push(data)
{
    var data = JSON.parse(data);
    console.log(data);
    var html = '<div class="frame">';
    html += '<h3 class="frame-header">';
    html += '<i class="icon iconfont icon-shijian"></i>第二节 02：30</h3>';
    html += '<div class="frame-item">';
    html += '<span class="frame-dot"></span>';
    html += '<div class="frame-item-author">';
    html += '<img src="'+data.logo+'" width="20px" height="20px" /> '+data.title+'</div>';
    html += '<p>'+data.content+'</p>'
    if(data.image != ''){
        html += '<p><img src="'+data.image+'" width="40%" /></p>'
    }
    html +='</div>';
    $('#match-result').prepend(html);
}